<%@ include file="/taglibs.jsp"%>


<head>
	<title><fmt:message key="submitonline.listForm.title"/></title>
	<script type="text/javascript" src="${ctx}/scripts/file_module.js"></script>	
</head>

<s:set name="filePubAdmins" value="filePubAdmins" scope="request"/>
<s:form name="listFilePublicAdminForm" action="listFilePublicAdmin" method="post">
<table class="table">
	<tr>
		<td width="100px">
	        <s:property value="getText('filePublicAdministration.inputDate.from')"/>
	    </td>
	    <td width="100px">
	        <s:textfield id="fromDate" readonly="true" name="fromDate" size="11" theme="simple"/>
	    </td>
		<td width="50px">
	        <s:property value="getText('filePublicAdministration.inputDate.to')"/>
	    </td>
		<td>
			<s:textfield id="toDate" readonly="true" name="toDate" size="11" theme="simple"/>
		</td>
		<td width="100px">
	        <s:property value="getText('filePublicAdministration.received')"/>
	    </td>
		<td>
			<s:checkbox labelposition="left" name="chkReceived" theme="simple" />
		</td>
	</tr>
	<tr>
		<td colspan="6">
		<button type="submit" onclick="this.blur()" class="button" name="search" >
					<fmt:message key="button.search.title"></fmt:message>
					<img src="${ctx}/images/btn_search.png" align="left" height="20"
						width="20">
				</button>
		</td>
	</tr>
</table>
</s:form>
<s:set var="item_name" value="%{getText('file.item_name')}" scope="page"></s:set>
<s:set var="items_name" value="%{getText('file.items_name')}" scope="page"></s:set>
<display:table name="filePubAdmins" class="table" requestURI="" id="fileList" pagesize="10" >
	<display:setProperty name="paging.banner.item_name" value="${item_name}"/>
	<display:setProperty name="paging.banner.items_name" value="${items_name}"/>
    <display:column property="[1]" sortable="true" titleKey="filePublicAdministration.formality">
    </display:column>
   <%--  <display:column sortable="true" titleKey="filePublicAdministration.inputDate">
    <fmt:formatDate value="${fileList[2]}" pattern="${df}"/>
    </display:column> --%>
    
    <c:if test="${fileList[3] == 1}">
	    <display:column sortable="true" titleKey="filePublicAdministration.type" escapeXml="true">
	      <fmt:message key="filePublicAdministration.type.CPXD"></fmt:message>
	    </display:column>
		<display:column sortable="true" media="html" paramId="id" paramProperty="[0]"  titleKey="file.action" >
	  			<s:url action="file-detail-issue-permission-construction" var="fileDetailURL">
					<s:param name="id" value="#attr.fileList[0]"></s:param>
				</s:url>								
		        <s:a href="%{fileDetailURL}" cssClass="button">
		    		<s:property value="getText('button.detail.title')"/>
		    	</s:a>
		</display:column>			   
    </c:if>
    <c:if test="${fileList[3] == 2}">
	    <display:column sortable="true" titleKey="filePublicAdministration.type" escapeXml="true">
	      <fmt:message key="filePublicAdministration.type.CCHN"></fmt:message>
	    </display:column>
		<display:column sortable="true" media="html" paramId="id" paramProperty="[0]"  titleKey="file.action" >
	  			<s:url action="file-detail-issue-certificate-practice" var="fileDetailURL">
					<s:param name="id" value="#attr.fileList[0]"></s:param>
				</s:url>								
		        <s:a href="%{fileDetailURL}" cssClass="button">
		    		<s:property value="getText('button.detail.title')"/>
		    	</s:a>	
		</display:column>			    
    </c:if>
    <c:if test="${fileList[3] == 3}">
	    <display:column sortable="true" titleKey="filePublicAdministration.type" escapeXml="true">
	      <fmt:message key="filePublicAdministration.type.CLCCHN"></fmt:message>
	    </display:column>
		<display:column sortable="true" media="html" paramId="id" paramProperty="[0]"  titleKey="file.action" >
	  			<s:url action="file-detail-reissue-certificate-practice" var="fileDetailURL">
					<s:param name="id" value="#attr.fileList[0]"></s:param>
				</s:url>								
		        <s:a href="%{fileDetailURL}" cssClass="button">
		    		<s:property value="getText('button.detail.title')"/>
		    	</s:a>	
		</display:column>		    
    </c:if>
        <c:if test="${fileList[3] == 4}">
	    <display:column sortable="true" titleKey="filePublicAdministration.type" escapeXml="true">
	      <fmt:message key="filePublicAdministration.type.DCGPXD"></fmt:message>
	    </display:column>
		<display:column sortable="true" media="html" paramId="id" paramProperty="[0]"  titleKey="file.action" >
	  			<s:url action="file-detail-adjust-certificate-practice" var="fileDetailURL">
					<s:param name="id" value="#attr.fileList[0]"></s:param>
				</s:url>								
		        <s:a href="%{fileDetailURL}" cssClass="button">
		    		<s:property value="getText('button.detail.title')"/>
		    	</s:a>	
		</display:column>			    
    </c:if>
    <c:if test="${fileList[3] == 5}">
	    <display:column sortable="true" titleKey="filePublicAdministration.type" escapeXml="true">
	      <fmt:message key="filePublicAdministration.type.GHCPXD"></fmt:message>
	    </display:column>
		<display:column sortable="true" media="html" paramId="id" paramProperty="[0]"  titleKey="file.action" >
	  			<s:url action="file-detail-extent-permission-construction" var="fileDetailURL">
					<s:param name="id" value="#attr.fileList[0]"></s:param>
				</s:url>								
		        <s:a href="%{fileDetailURL}" cssClass="button">
		    		<s:property value="getText('button.detail.title')"/>
		    	</s:a>	
		</display:column>				    
    </c:if>
    <c:if test="${fileList[3] == 6}">
	    <display:column sortable="true" titleKey="filePublicAdministration.type" escapeXml="true">
	      <fmt:message key="filePublicAdministration.type.BSCCHN"></fmt:message>
	    </display:column>
		<display:column sortable="true" media="html" paramId="id" paramProperty="[0]"  titleKey="file.action" >
	  			<s:url action="file-detail-update-certificate-practice" var="fileDetailURL">
					<s:param name="id" value="#attr.fileList[0]"></s:param>
				</s:url>								
		        <s:a href="%{fileDetailURL}" cssClass="button">
		    		<s:property value="getText('button.detail.title')"/>
		    	</s:a>	
		</display:column>				    
    </c:if>
    <c:if test="${fileList[3] == 7}">
	    <display:column sortable="true" titleKey="filePublicAdministration.type" escapeXml="true">
	      <fmt:message key="filePublicAdministration.type.CCCMGBDS"></fmt:message>
	    </display:column>
		<display:column sortable="true" media="html" paramId="id" paramProperty="[0]"  titleKey="file.action" >
	  			<s:url action="file-detail-issue-real-estate" var="fileDetailURL">
					<s:param name="id" value="#attr.fileList[0]"></s:param>
				</s:url>								
		        <s:a href="%{fileDetailURL}" cssClass="button">
		    		<s:property value="getText('button.detail.title')"/>
		    	</s:a>	
		</display:column>				    
    </c:if>
</display:table>

<script type="text/javascript">
                                          
      
	var cal = Calendar.setup({
		onSelect : function(cal) {
			cal.hide();
		},
	});
	cal.manageFields("fromDate", "fromDate", "%d/%m/%Y");
	cal.manageFields("toDate", "toDate", "%d/%m/%Y");

	var currentTime = new Date();
	var month = currentTime.getMonth() + 1;
	var day = currentTime.getDate();
	if (month < 10)
		month = "0" + month;
	if (day < 10)
		day = "0" + day;
	var year = currentTime.getFullYear();

	var today = day + "/" + month + "/" + year;

	if ($("#fromDate").val() == "")
		$("#fromDate").val(today);

	if ($("#toDate").val() == "")
		$("#toDate").val(today);
</script>
